package cn.appsys.service.impl;

import cn.appsys.dao.CategoryMapper;
import cn.appsys.pojo.Category;
import cn.appsys.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 分类业务层实现类
 * CategoryServiceImpl
 * Created by Super Cui on 2017/10/14.
 */
@Service("categoryService")
public class CategoryServiceImpl implements CategoryService {
    @Autowired
    CategoryMapper categoryMapper;

    public CategoryMapper getCategoryMapper() {
        return categoryMapper;
    }

    public void setCategoryMapper(CategoryMapper categoryMapper) {
        this.categoryMapper = categoryMapper;
    }

    @Override
    public Boolean addCategory(Category category) {
        return categoryMapper.addCategory(category);
    }

    @Override
    public Boolean delCategory(Category category) {
        return categoryMapper.delCategory(category);
    }

    @Override
    public Boolean updateCategory(Category category) {
        return categoryMapper.updateCategory(category);
    }

    @Override
    public Category getCategoryById(Category category) {
        return categoryMapper.getCategoryById(category);
    }

    @Override
    public List<Category> queryCategoryLevel1() {
        return categoryMapper.queryCategoryLevel1();
    }

    @Override
    public List<Category> queryCategoryLevel2(Category category) {
        return categoryMapper.queryCategoryLevel2(category);
    }
}
